]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shellActionModes: disable POPUP keybindings in unlock screen
authorRay Strode <rstrode@redhat.com>
Wed, 23 Jan 2019 20:59:42 +0000 (15:59 -0500)
committerRay Strode <rstrode@redhat.com>
Tue, 5 Feb 2019 16:09:40 +0000 (11:09 -0500)
Certain keybindings should continue to work even when a popup
menu is on screen. For instance, the keybinding for showing
the app menu and the keyinding for showing the calendar are
examples.

This is achieved by putting in place a special "POPUP" action
mode, whenever a popup menu is active.  This mode replaces
the (e.g., "NORMAL" or "OVERVIEW") action mode that was in place
for as long as the popup menu is active.

But those keybindings should not work when the user is at the
unlock dialog (which uses an action mode of "UNLOCK").

Unfortunately, since commit c79d24b6 they do.

This commit addresses the problem by forcing the action mode
to NONE at the unlock screen when popups are visible.

CVE-2019-3820

Closes https://gitlab.gnome.org/GNOME/gnome-shell/issues/851

js/gdm/authPrompt.js
js/gdm/loginDialog.js
js/ui/shellEntry.js

index 6dd5cdba667d6924b709cf3436ca084b0f4b34c6..eb21d96553bda3102f4a5a1951fcfe721647bd71 100644 (file)
@@ -10,6 +10,7 @@ const Animation = imports.ui.animation;
 const Batch = imports.gdm.batch;
 const GdmUtil = imports.gdm.util;
 const Params = imports.misc.params;
+const Shell = imports.gi.Shell;
 const ShellEntry = imports.ui.shellEntry;
 const Tweener = imports.ui.tweener;
 const UserWidget = imports.ui.userWidget;
@@ -96,7 +97,7 @@ var AuthPrompt = class {
                          x_align: St.Align.START });
         this._entry = new St.Entry({ style_class: 'login-dialog-prompt-entry',
                                      can_focus: true });
-        ShellEntry.addContextMenu(this._entry, { isPassword: true });
+        ShellEntry.addContextMenu(this._entry, { isPassword: true, actionMode: Shell.ActionMode.NONE });
 
         this.actor.add(this._entry,
                        { expand: true,
index 55ba3801e468e1a1f64ee61be9a55eefab224cc1..dc125c2137412e1755e09536932c779ef555db10 100644 (file)
@@ -334,7 +334,8 @@ var SessionMenuButton = class {
                  this._button.remove_style_pseudo_class('active');
         });
 
-        this._manager = new PopupMenu.PopupMenuManager({ actor: this._button });
+        this._manager = new PopupMenu.PopupMenuManager({ actor: this._button },
+                                                       { actionMode: Shell.ActionMode.NONE });
         this._manager.addMenu(this._menu);
 
         this._button.connect('clicked', () => { this._menu.toggle(); });
index 0b733eb6590eeeeb3a3aa4a2b2408f056ef49cdc..d16de92861e467eeb03d46d683ef5a1b300f9cd2 100644 (file)
@@ -7,6 +7,7 @@ const BoxPointer = imports.ui.boxpointer;
 const Main = imports.ui.main;
 const Params = imports.misc.params;
 const PopupMenu = imports.ui.popupMenu;
+const Shell = imports.gi.Shell;
 
 var EntryMenu = class extends PopupMenu.PopupMenu {
     constructor(entry) {
@@ -145,11 +146,12 @@ function addContextMenu(entry, params) {
     if (entry.menu)
         return;
 
-    params = Params.parse (params, { isPassword: false });
+    params = Params.parse (params, { isPassword: false, actionMode: Shell.ActionMode.POPUP });
 
     entry.menu = new EntryMenu(entry);
     entry.menu.isPassword = params.isPassword;
-    entry._menuManager = new PopupMenu.PopupMenuManager({ actor: entry });
+    entry._menuManager = new PopupMenu.PopupMenuManager({ actor: entry },
+                                                        { actionMode: params.actionMode });
     entry._menuManager.addMenu(entry.menu);
 
     // Add an event handler to both the entry and its clutter_text; the former